/**
 * @fileOverview diagram edge
 * @author huangtonger@aliyun.com
 */
const Diagram = require('../../diagram');
const Util = require('../../util/');
const Global = require('../../global');

Diagram.registerEdge('diagram-base', {
  getPath(item) {
    const points = item.getPoints();
    const source = item.getSource();
    const target = item.getTarget();
    return this.getPathByPoints({ points, source, target, item });
  },
  getPathByPoints({ points }) {
    return Util.pointsToPolygon(points);
  },
  getStyle(item) {
    const model = item.getModel();
    return Util.mix(true, {}, Global.edgeStyle, {
      stroke: model.color
    }, model.style);
  },
  getActivedStyle(/* item */) {
    return Global.edgeActivedStyle;
  },
  getSelectedStyle(/* item */) {
    return Global.edgeSelectedStyle;
  },
  getActivedOutterStyle(/* item */) {

  },
  getSelectedOutterStyle(/* item */) {

  }
});
